package com.gs.zsmanage.dao;

import com.gs.zsmanage.entity.CustomLive;
import com.gs.zsmanage.entity.Element;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CustomLiveMapper {

    List<CustomLive> listAllDepartmentAndStationType();

    //select * FROM t_custom_live WHERE department = '渔业管理局' AND station_type = '区域自动站'
    CustomLive listCustomLiveByDepartmentAndStationType(@Param("department") String department, @Param("stationType") String stationType);

    //select * FROM t_element WHERE station_type = '区域自动站' AND id in (SELECT element_id FROM t_live_element WHERE live_id = 1008)
    List<Element> listLiveElementsByStationTypeAndLiveId(@Param("stationType") String stationType, @Param("liveId") Integer liveId);

    //select * from t_element where station_type  = '区域自动站'
    List<Element> listAllElementsByStationType(String stationType);


    void addLiveElement(@Param("liveId") Integer liveId, @Param("elementId") Integer elementId);

    void deleteLiveElement(@Param("liveId") Integer liveId, @Param("elementId") Integer elementId);

    void updateLiveStations(@Param("liveId") Integer liveId, @Param("stations") String stations);

    void updateVisible(@Param("liveId") Integer liveId, @Param("v") Integer v);

}
